<%@ page import="com.lagou.domain.Student" %>
<%@ page import="java.util.List" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%
    List<Student> students = (List<Student>)request.getAttribute("students");
%>
<html>
<head>
    <title>学生管理系统-首页</title>

    <style>
        .login-form{
            position: absolute;
            left: 32%;
            width: 354px;
            font-family: "Microsoft Yahei","微软雅黑",Arial,STHeiti;
            border: 1px solid #efefef;
            box-shadow: 1px 1px 1px #efefef;
            padding-top: 25px;
            background-color:blanchedalmond;
        }
    </style>

    <div class="login-form">
        <table border="1px" align="center" cellspacing="0">
            <tr>
                <th>学号</th>
                <th>姓名</th>
                <th>性别</th>
                <th>生日</th>
                <th>编辑</th>
                <th>删除</th>
            </tr>

            <%for ( int i = 0; i < students.size(); i++){ %>
                <% Student stu = students.get(i);%>
                <tr>
                    <td><%out.println(stu.getId());%></td>
                    <td><%out.println(stu.getStname());%></td>
                    <td><%out.println(stu.getSex().equals("1")?"男":"女");%></td>
                    <td><%out.println(stu.getBirthday());%></td>
                    <td><button><a href="/student_system/editStu?id=<%out.println(stu.getId());%>">修改</a></button></td>
                    <td><button><a href="/student_system/deleteStu?id=<%out.println(stu.getId());%>">删除</a></button></td>
                </tr>
            <%}%>


        </table>

        <P><button><a href="/student_system/addStu.html">添加学生</a></button></P>
        <P><button><a href="/student_system/index.html">返回登录页面</a></button></P>
    </div>

</head>
<body>

</body>
</html>
